package com.service;

import com.huawei.demo.Demo;
import com.object.Result;

import java.util.Random;
import java.util.Scanner;

public class StoneScissorClothImpl implements StoneScissorCloth{//,ResultOperation
    /**
     * 人0-输了，1-赢了，2-平了
     *
     * @param person
     */
    @Override

    public void gameStandard( String person) {
        Random random = new Random();
        ResultOperationlmp s = new ResultOperationlmp();//调用ResultOperationlmp的数据
        Result n = new Result();//调用返回值

        Scanner input = new Scanner(System.in);//调用输入
            for (int i = 1; i <= 5; i++) {
                System.out.println("第" + i + "局");

                int coumputer = random.nextInt(3) + 1;

                Result a = s.gameStandard();//调用ResultOperationlmp结果
                if(i == 5)
                {
                    break;
                }
                person = input.next();

                /*n.getPersonandComputerDraws();
                n.getPersonWin();
                n.getComputerWin();*/

                /**
                if (coumputer == 1) {
                    if (uer.equals("石头")) {
                        System.out.println("电脑出的是石头");
                        System.out.println("平局");dogfallNumber++;
                    }
                    if (uer.equals("剪刀")) {
                        System.out.println("电脑出的是石头");
                        System.out.println("电脑获胜");computerWinNumber++;
                    }
                    if (uer.equals("布")) {
                        System.out.println("电脑出的是石头");
                        System.out.println("获胜");playerWinNumber++;
                    }
                }
                if (coumputer == 2) {
                    if (uer.equals("石头")) {
                        System.out.println("电脑出的是剪刀");
                        System.out.println("获胜");playerWinNumber++;
                    }
                    if (uer.equals("剪刀")) {
                        System.out.println("电脑出的是剪刀");
                        System.out.println("平局");dogfallNumber++;
                    }
                    if (uer.equals("布")) {
                        System.out.println("电脑出的是剪刀");
                        System.out.println("电脑获胜");computerWinNumber++;
                    }
                }
                if (coumputer == 3) {
                    if (uer.equals("石头")) {
                        System.out.println("电脑出的是布");
                        System.out.println("电脑获胜");computerWinNumber++;
                    }
                    if (uer.equals("剪刀")) {
                        System.out.println("电脑出的是布");
                        System.out.println("获胜");playerWinNumber++;
                    }
                    if (uer.equals("布")) {
                        System.out.println("电脑出的是布");
                        System.out.println("平局");dogfallNumber++;
                    }
                }
                if(!uer.matches("石头|剪刀|布")) {
                    System.out.println("输入错误");continue;
                }
            }
            if(playerWinNumber>computerWinNumber)
            {
                System.out.println("比赛结果：恭喜！你赢得比赛。");
            }
            else if(playerWinNumber<computerWinNumber)
            {
                System.out.println("比赛结果：可惜！你比赛失败。");
            }
            else
            {
                System.out.println("比赛结果：你与电脑打成平手。");
            }
        System.out.println("你本轮游戏：赢了"+playerWinNumber+"局 平了"+dogfallNumber+"局 输了"+computerWinNumber+"局");
        }
    public void gameStandard() {
    }*/
            }
    }
}